/*
 * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
 *
 * SPDX-License-Identifier: CC0-1.0
 */

#include <stdio.h>
#include <inttypes.h>
#include "partition_driver.h"

#define LOCAL_NAME "storage"

void app_main(void)
{
    static char store_data[] = "Test the read, write, and erase operations of the entire partition.\n\
                                Test the read, write, and erase operations of the entire partition.\n\
                                Test the read, write, and erase operations of the entire partition.\n\
                                Test the read, write, and erase operations of the entire partition.\n\
                                Test the read, write, and erase operations of the entire partition.\n\
                                Test the read, write, and erase operations of the entire partition.";
    static char read_data[sizeof(store_data)];
    memset(read_data, 0xFF, sizeof(read_data));

    partition_flash_write_quick(0,store_data,sizeof(store_data),LOCAL_NAME);
    partition_flash_read_quick(0,read_data,sizeof(store_data),LOCAL_NAME);

    assert(memcmp(store_data, read_data, sizeof(read_data)) == 0);
    printf("read data: %s", read_data);
}
